#usr/bin/python

from core import objects as obj

class BioCyc_parser:
		"""Parser flat file biocyc"""
		
		def __init__ (self):
			"""Constructor"""
			
			self.file_name ="config\LinksBioCycKegg.txt"
			
		def parsing(self):
			"""Parsing Function"""
			
			datas =[]
			with open( self.file_name) as f:
				line =f.readline()
				while  line != "":
					# (self,  mass,  formula,  name,  synonyms,  kegg_entry,  biocyc_entry,  smiles)
					transformed_line = line.split('\t')
					data = obj.BioCyc( transformed_line[4], transformed_line[3],  transformed_line[6].split('\s')[1:], transformed_line[1], transformed_line[0],  transformed_line[5]  )
					line =f.readline()
					datas.append(data)
			return datas
			
